/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.hazard.sds.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicModDictEnum;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.bizz.common.core.util.DateUtils;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 危化品出库记录
 *
 * @author daijie
 * @date 2023-11-13 19:29:15
 */
@Data
@TableName("haz_chemical_out")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "危化品出库记录")
public class HazChemicalOutEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 危化品标识
     */
    @Schema(description = "危化品标识")
    private Long chemicalId;

    /**
     * 出库类型
     */
    @Schema(description = "出库类型")
    private String outStorageType;

    /**
     * 存储位置
     */
    @Schema(description = "存储位置")
    private Long storageLocationId;

    /**
     * 存储位置描述
     */
    @Schema(description = "存储位置描述")
    private String storageLocationDesc;

    /**
     * 去向
     */
    @Schema(description = "去向")
    private String chemicalSource;

    /**
     * 出库时间
     */
    @Schema(description = "出库时间")
    private Date outDate;

    /**
     * 出库数量
     */
    @Schema(description = "出库数量")
    private BigDecimal outNumber;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 单据
     */
    @Schema(description = "单据")
    private String billFile;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    public String getOrgIdStr(){
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company,this.orgId);

    }

    public String getOutDateStr() {
        return DateUtils.limitDay(this.outDate);
    }

    public String getStorageLocationIdStr() {
        return "存储场所";
    }

    public String getChemicalIdStr() {
        return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.chemical_sds, this.chemicalId);
    }

    public String getOutStorageTypeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.hazard_out_storage_type, this.outStorageType);
    }
}
